<script setup lang="ts">
const props = defineProps<{
  prescriptionId: string
}>()
const emits = defineEmits<{
  (e: 'delOrder'): void
  (e: 'lookPreview', id: string): void
}>()
const selectEvent = (item: any, index: number) => {
  if (index === 0) {
    emits('lookPreview', props.prescriptionId)
  } else {
    emits('delOrder')
  }
}
// const actions = [{ text: '查看处方', disabled: !props.prescriptionId }, { text: '删除订单' }]
</script>

<template>
  <van-popover
    :actions="[{ text: '查看处方', disabled: !props.prescriptionId }, { text: '删除订单' }]"
    placement="top"
    @select="selectEvent"
  >
    <template #reference>
      <van-button class="gray" plain size="small" round>更多</van-button>
    </template>
  </van-popover>
</template>

<style lang="scss" scoped></style>
